package gui;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.border.LineBorder;

public class GenomeDisplayFrame extends JFrame {
	
	private String genome;
	
	private JPanel containerPanel;
	private JTextArea genomeText;
	
	private final Color bkg = new Color(255,99,71);
	
	public GenomeDisplayFrame(String program){
		genome = program;
		
		setSize(400, 500);
		setTitle("View selected critter's genome");
		containerPanel = new JPanel();
		containerPanel.setBorder(new LineBorder(bkg, 3));
		add(containerPanel);
		
		if(genome == null || genome.equals("")){
			genomeText = new JTextArea("No program available for this critter"){
				public Dimension getMinimumSize(){
					return new Dimension(100, 400);
				}
			};
		} else{
			genomeText = new JTextArea(genome){
				public Dimension getMinimumSize(){
					return new Dimension(100, 400);
				}
			};
		}
		genomeText.setEditable(false);
		containerPanel.add(genomeText);

		containerPanel.setBackground(bkg);
		genomeText.setBackground(bkg);
		setVisible(true);
	}
}
